HAL I3C I/O operation functions migration

This section provides information about the HAL I3C function migration.

HAL I3C abort using interrupt

HAL1

HAL2

HAL_I3C_Abort_IT(I3C_HandleTypeDef *hi3c);
HAL_I3C_Abort_IT(hal_i3c_handle_t *hi3c);

HAL I3C activate notification

In HAL1, the function HAL_I3C_ActivateNotification takes the parameter interruptMask, which can be any combination of I3C_TARGET_INTERRUPT when the I3C is in target mode, or a combination of I3C_CONTROLLER_INTERRUPT when in controller mode. In HAL2, this functionality is split into two separate functions HAL_I3C_CTRL_ActivateNotification and HAL_I3C_TGT_ActivateNotification, each specific to either target or controller mode.

HAL1

HAL2

HAL_I3C_ActivateNotification(I3C_HandleTypeDef *hi3c, I3C_XferTypeDef *pXferData,
                             uint32_t interruptMask);
HAL_I3C_CTRL_ActivateNotification(hal_i3c_handle_t *hi3c, uint32_t notification_mask);
/* or */
HAL_I3C_TGT_ActivateNotification(hal_i3c_handle_t *hi3c, uint8_t *p_data, uint32_t size_byte,
                                 uint32_t notification_mask);

HAL I3C add descriptor to frame

In HAL2, the API HAL_I3C_AddDescToFrame() has been split in multiple functions. Only one of these functions HAL_I3C_CTRL_BuildTransferCtxPrivate, HAL_I3C_CTRL_BuildTransferCtxCCC can be used at a time; they cannot be executed simultaneously. For more details see Other HAL I3C changes.

HAL1

HAL2

HAL_I3C_AddDescToFrame(I3C_HandleTypeDef         *hi3c,
                       const I3C_CCCTypeDef      *pCCCDesc,
                       const I3C_PrivateTypeDef  *pPrivateDesc,
                       I3C_XferTypeDef           *pXferData,
                       uint8_t                    nbFrame,
                       uint32_t                   option);
HAL_I3C_CTRL_InitTransferCtxTc(hal_i3c_transfer_ctx_t *p_ctx, uint32_t *p_ctrl_buf, uint32_t size_word);
HAL_I3C_CTRL_InitTransferCtxTx(hal_i3c_transfer_ctx_t *p_ctx, const uint8_t *p_tx_data, uint32_t size_byte);
HAL_I3C_CTRL_InitTransferCtxRx(hal_i3c_transfer_ctx_t *p_ctx, uint8_t *p_rx_data, uint32_t size_byte);

HAL_I3C_CTRL_BuildTransferCtxPrivate(hal_i3c_transfer_ctx_t *p_ctx, const hal_i3c_private_desc_t *p_desc,
                                              uint32_t nb_desc, hal_i3c_transfer_mode_t mode);

HAL_I3C_CTRL_BuildTransferCtxCCC(hal_i3c_transfer_ctx_t *p_ctx, const hal_i3c_ccc_desc_t *p_desc, uint32_t nb_desc,
                                          hal_i3c_transfer_mode_t mode);

HAL I3C clear configuration FIFO

HAL1

HAL2

HAL_I3C_ClearConfigFifo(I3C_HandleTypeDef *hi3c);
HAL_I3C_CTRL_DisableStatusFifo(hal_i3c_handle_t *hi3c);

HAL I3C controller bus characteristics configuration

HAL1

HAL2

HAL_I3C_Ctrl_BusCharacteristicConfig(I3C_HandleTypeDef *hi3c,
                                     const LL_I3C_CtrlBusConfTypeDef *pConfig);
HAL_I3C_CTRL_SetConfig(hal_i3c_handle_t *hi3c, const hal_i3c_ctrl_config_t *p_config);

HAL I3C controller configuration

HAL1

HAL2

HAL_I3C_Ctrl_Config(I3C_HandleTypeDef *hi3c, const I3C_CtrlConfTypeDef *pConfig);
HAL_I3C_CTRL_SetConfig(hal_i3c_handle_t *hi3c, const hal_i3c_ctrl_config_t *p_config);

HAL I3C bus devices configuration

HAL1

HAL2

HAL_I3C_Ctrl_ConfigBusDevices(I3C_HandleTypeDef           *hi3c,
                              const I3C_DeviceConfTypeDef *pDesc,
                              uint8_t                     nbDevice);
HAL_I3C_CTRL_SetConfigBusDevices(const hal_i3c_handle_t *hi3c, const hal_i3c_ctrl_device_config_t *p_desc,
                                 uint32_t nb_device);

HAL I3C controller assign dynamic address

HAL1

HAL2

HAL_I3C_Ctrl_DynAddrAssign(I3C_HandleTypeDef *hi3c,
                           uint64_t          *target_payload,
                           uint32_t           dynOption,
                           uint32_t           timeout);
hal_status_t HAL_I3C_CTRL_DynAddrAssign(hal_i3c_handle_t *hi3c, uint64_t *p_target_payload,
                               hal_i3c_dyn_addr_opt_t option,
                               hal_i3c_target_detection_status_t *p_target_detection_status,
                               uint32_t timeout_ms);

HAL I3C assign dynamic address using interrupt

HAL1

HAL2

HAL_I3C_Ctrl_DynAddrAssign_IT(I3C_HandleTypeDef *hi3c, uint32_t dynOption);
HAL_I3C_CTRL_DynAddrAssign_IT(hal_i3c_handle_t *hi3c, hal_i3c_dyn_addr_opt_t  dyn_option);

HAL I3C controller generates arbitration

HAL1

HAL2

HAL_I3C_Ctrl_GenerateArbitration(I3C_HandleTypeDef *hi3c, uint32_t timeout);
HAL_I3C_CTRL_GenerateArbitration(hal_i3c_handle_t *hi3c, uint32_t timeout_ms);

HAL I3C get reset pattern configuration

HAL1

HAL2

HAL_I3C_Ctrl_GetConfigResetPattern(I3C_HandleTypeDef *hi3c, uint32_t *pResetPattern);
HAL_I3C_Ctrl_GetConfigResetPattern(I3C_HandleTypeDef *hi3c, uint32_t *pResetPattern);

HAL I3C check the I2C device is ready

In HAL1, the user provides a number of trials and a timeout. The function checks whether the device is ready and returns device ready as soon as it succeeds, or device is not ready if the trial count or timeout is reached.

In HAL2, the trials parameter is removed. The function keeps checking if the device is ready until either the device becomes ready or the timeout is reached. There is no longer any limit on the number of trials; only the timeout constrains the execution.

HAL1

HAL2

HAL_I3C_Ctrl_IsDeviceI2C_Ready(I3C_HandleTypeDef *hi3c,
                               uint8_t            devAddress,
                               uint32_t           trials,
                               uint32_t           timeout);
hal_status_t HAL_I3C_CTRL_PoolForDeviceI2cReady(hal_i3c_handle_t *hi3c, uint8_t target_address, uint32_t timeout_ms);

HAL I3C check the I3C device is ready

In HAL1, the user provides a number of trials and a timeout. The function checks whether the device is ready and returns device ready as soon as it succeeds, or device is not ready if the trial count or timeout is reached.

In HAL2, the trials parameter is removed. The function keeps checking if the device is ready until either the device becomes ready or the timeout is reached. There is no longer any limit on the number of trials; only the timeout constrains the execution.

HAL1

HAL2

HAL_I3C_Ctrl_IsDeviceI3C_Ready(I3C_HandleTypeDef *hi3c,
                               uint8_t            devAddress,
                               uint32_t           trials,
                               uint32_t           timeout);
HAL_I3C_CTRL_PoolForDeviceI3cReady(hal_i3c_handle_t *hi3c, uint8_t target_address, uint32_t timeout_ms);

HAL I3C multiple transfer using DMA

HAL1

HAL2

HAL_I3C_Ctrl_MultipleTransfer_DMA(I3C_HandleTypeDef   *hi3c,
                                  I3C_XferTypeDef     *pXferData);
HAL_I3C_CTRL_Transfer_DMA(hal_i3c_handle_t *hi3c, const hal_i3c_transfer_ctx_t *p_ctx);

Related use case: Use case: HAL I3C controller multiple direct CCC command


HAL I3C multiple transfer using interrupt

HAL1

HAL2

HAL_I3C_Ctrl_MultipleTransfer_IT(I3C_HandleTypeDef   *hi3c,
                                 I3C_XferTypeDef     *pXferData);
HAL_I3C_CTRL_Transfer_IT(hal_i3c_handle_t *hi3c, const hal_i3c_transfer_ctx_t *p_ctx);

Related use case: Use case: HAL I3C controller multiple direct CCC command


HAL I3C controller receive data

HAL1

HAL2

HAL_I3C_Ctrl_Receive(I3C_HandleTypeDef   *hi3c,
                     I3C_XferTypeDef     *pXferData,
                     uint32_t             timeout);
HAL_I3C_CTRL_Transfer(hal_i3c_handle_t *hi3c, const hal_i3c_transfer_ctx_t *p_ctx, uint32_t timeout_ms);

Related use case: Use case: HAL I3C controller private read


HAL controller transmit direct read CCC command in polling mode

HAL1

HAL2

HAL_I3C_Ctrl_ReceiveCCC(I3C_HandleTypeDef *hi3c,
                        I3C_XferTypeDef   *pXferData,
                        uint32_t           timeout);
HAL_I3C_CTRL_Transfer(hal_i3c_handle_t *hi3c, const hal_i3c_transfer_ctx_t *p_ctx, uint32_t timeout_ms);

Related use case: Use case: HAL I3C controller receive direct read CCC command


HAL controller receive CCC command using DMA

HAL1

HAL2

HAL_I3C_Ctrl_ReceiveCCC_DMA(I3C_HandleTypeDef *hi3c,
                            I3C_XferTypeDef   *pXferData);
HAL_I3C_CTRL_Transfer_DMA(hal_i3c_handle_t *hi3c, const hal_i3c_transfer_ctx_t *p_ctx);

Related use case: Use case: HAL I3C controller receive direct read CCC command


HAL I3C controller receive CCC command using interrupt

HAL1

HAL2

HAL_I3C_Ctrl_ReceiveCCC_IT(I3C_HandleTypeDef *hi3c,
                           I3C_XferTypeDef   *pXferData);
HAL_I3C_CTRL_Transfer_IT(hal_i3c_handle_t *hi3c, const hal_i3c_transfer_ctx_t *p_ctx);

Related use case: Use case: HAL I3C controller receive direct read CCC command


HAL I3C controller receive data using DMA

HAL1

HAL2

HAL_I3C_Ctrl_Receive_DMA(I3C_HandleTypeDef   *hi3c,
                         I3C_XferTypeDef     *pXferData);
HAL_I3C_CTRL_Transfer_DMA(hal_i3c_handle_t *hi3c, const hal_i3c_transfer_ctx_t *p_ctx);

Related use case: Use case: HAL I3C controller private read


HAL I3C controller receive data using interrupt

HAL1

HAL2

HAL_I3C_Ctrl_Receive_IT(I3C_HandleTypeDef   *hi3c,
                        I3C_XferTypeDef     *pXferData);
HAL_I3C_CTRL_Transfer_IT(hal_i3c_handle_t *hi3c, const hal_i3c_transfer_ctx_t *p_ctx);

Related use case: Use case: HAL I3C controller private read


HAL I3C set reset pattern configuration

HAL1

HAL2

HAL_I3C_Ctrl_SetConfigResetPattern(I3C_HandleTypeDef *hi3c, uint32_t resetPattern);
HAL_I3C_CTRL_EnableResetPattern(hal_i3c_handle_t *hi3c);
HAL_I3C_CTRL_DisableResetPattern(hal_i3c_handle_t *hi3c);

HAL I3C controller set dynamic address

HAL1

HAL2

HAL_I3C_Ctrl_SetDynAddr(I3C_HandleTypeDef *hi3c, uint8_t devAddress);
HAL_I3C_CTRL_SetConfigOwnDynamicAddress(hal_i3c_handle_t *hi3c, uint32_t dynamic_address);

HAL I3C controller Transmit data

HAL1

HAL2

HAL_I3C_Ctrl_Transmit(I3C_HandleTypeDef   *hi3c,
                      I3C_XferTypeDef     *pXferData,
                      uint32_t             timeout);
HAL_I3C_CTRL_Transfer(hal_i3c_handle_t *hi3c, const hal_i3c_transfer_ctx_t *p_ctx, uint32_t timeout_ms);

Related use case: Use case: HAL I3C controller private write


HAL I3C controller transmit CCC command

HAL1

HAL2

HAL_I3C_Ctrl_TransmitCCC(I3C_HandleTypeDef *hi3c,
                         I3C_XferTypeDef   *pXferData,
                         uint32_t           timeout);
HAL_I3C_CTRL_Transfer(hal_i3c_handle_t *hi3c, const hal_i3c_transfer_ctx_t *p_ctx, uint32_t timeout_ms);

Related use case: Use case: HAL I3C controller transmit direct write CCC command


HAL I3C transmit CCC command using DMA

HAL1

HAL2

HAL_I3C_Ctrl_TransmitCCC_DMA(I3C_HandleTypeDef *hi3c,
                             I3C_XferTypeDef   *pXferData);
HAL_I3C_CTRL_Transfer_DMA(hal_i3c_handle_t *hi3c, const hal_i3c_transfer_ctx_t *p_ctx);

Related use case: Use case: HAL I3C controller transmit direct write CCC command


HAL I3C controller transmit CCC command using interrupt

HAL1

HAL2

HAL_I3C_Ctrl_TransmitCCC_IT(I3C_HandleTypeDef *hi3c,
                            I3C_XferTypeDef   *pXferData);
HAL_I3C_CTRL_Transfer_IT(hal_i3c_handle_t *hi3c, const hal_i3c_transfer_ctx_t *p_ctx);

Related use case: Use case: HAL I3C controller transmit direct write CCC command


HAL I3C controller transmit data using DMA

HAL1

HAL2

HAL_I3C_Ctrl_Transmit_DMA(I3C_HandleTypeDef   *hi3c,
                          I3C_XferTypeDef     *pXferData);
HAL_I3C_CTRL_Transfer_DMA(hal_i3c_handle_t *hi3c, const hal_i3c_transfer_ctx_t *p_ctx);

Related use case: Use case: HAL I3C controller private write


HAL I3C controller transmit data using interrupt

HAL1

HAL2

HAL_I3C_Ctrl_Transmit_IT(I3C_HandleTypeDef   *hi3c,
                         I3C_XferTypeDef     *pXferData);
HAL_I3C_CTRL_Transfer_IT(hal_i3c_handle_t *hi3c, const hal_i3c_transfer_ctx_t *p_ctx);

Related use case: Use case: HAL I3C controller private write


HAL I3C deactivate notification

HAL1

HAL2

HAL_I3C_DeactivateNotification(I3C_HandleTypeDef *hi3c, uint32_t interruptMask);
HAL_I3C_CTRL_DeactivateNotification(hal_i3c_handle_t *hi3c, uint32_t notification_mask);
HAL_I3C_TGT_DeactivateNotification(hal_i3c_handle_t *hi3c, uint32_t notification_mask);

HAL I3C flush all FIFOs

HAL1

HAL2

HAL_I3C_FlushAllFifo(I3C_HandleTypeDef *hi3c);
HAL_I3C_FlushAllFifos(const hal_i3c_handle_t *hi3c);

HAL I3C flush control FIFO

HAL1

HAL2

HAL_I3C_FlushControlFifo(I3C_HandleTypeDef *hi3c);
HAL_I3C_CTRL_FlushControlFifo(const hal_i3c_handle_t *hi3c);

HAL I3C flush RX FIFO

HAL1

HAL2

HAL_I3C_FlushRxFifo(I3C_HandleTypeDef *hi3c);
HAL_I3C_FlushRxFifo(const hal_i3c_handle_t *hi3c);

HAL I3C flush status FIFO

HAL1

HAL2

HAL_I3C_FlushStatusFifo(I3C_HandleTypeDef *hi3c);
HAL_I3C_CTRL_FlushStatusFifo(const hal_i3c_handle_t *hi3c);

HAL I3C flush TX FIFO

HAL1

HAL2

HAL_I3C_FlushTxFifo(I3C_HandleTypeDef *hi3c);
HAL_I3C_FlushTxFifo(const hal_i3c_handle_t *hi3c);

HAL I3C get common command code information

HAL1

HAL2

HAL_I3C_GetCCCInfo(I3C_HandleTypeDef *hi3c,
                   uint32_t notifyId,
                   I3C_CCCInfoTypeDef *pCCCInfo);
HAL_I3C_GetCCCInfo(const hal_i3c_handle_t *hi3c, uint32_t notify_id, hal_i3c_ccc_info_t *p_ccc_info);

HAL I3C get configuration FIFO

HAL1

HAL2

HAL_I3C_GetConfigFifo(I3C_HandleTypeDef *hi3c, I3C_FifoConfTypeDef *pConfig);
HAL_I3C_CTRL_GetConfigFifo(const hal_i3c_handle_t *hi3c, hal_i3c_ctrl_fifo_config_t *p_config);
HAL_I3C_TGT_GetConfigFifo(const hal_i3c_handle_t *hi3c, hal_i3c_tgt_fifo_config_t *p_config);

HAL I3C get mode

HAL1

HAL2

HAL_I3C_GetMode(const I3C_HandleTypeDef *hi3c);
HAL_I3C_GetMode(const hal_i3c_handle_t *hi3c);

HAL I3C get ENTDAA payload info

HAL1

HAL2

HAL_I3C_Get_ENTDAA_Payload_Info(I3C_HandleTypeDef *hi3c,
                                uint64_t ENTDAA_payload,
                                I3C_ENTDAAPayloadTypeDef *pENTDAA_payload);
HAL_I3C_CTRL_GetENTDAA_PayloadInfo(uint64_t entdaa_payload, hal_i3c_entdaa_payload_t *p_entdaa_payload);

HAL I3C set configuration FIFO

HAL1

HAL2

HAL_I3C_SetConfigFifo(I3C_HandleTypeDef *hi3c, const I3C_FifoConfTypeDef *pConfig);
HAL_I3C_CTRL_SetConfigFifo(const hal_i3c_handle_t *hi3c, const hal_i3c_ctrl_fifo_config_t *p_config);
HAL_I3C_TGT_SetConfigFifo(const hal_i3c_handle_t *hi3c, const hal_i3c_tgt_fifo_config_t *p_config);

HAL I3C configure target bus characteristic

HAL1

HAL2

HAL_I3C_Tgt_BusCharacteristicConfig(I3C_HandleTypeDef *hi3c,
                                    const LL_I3C_TgtBusConfTypeDef *pConfig);
HAL_I3C_TGT_SetConfig(hal_i3c_handle_t *hi3c, const hal_i3c_tgt_config_t *p_config);

HAL I3C configure target

HAL1

HAL2

HAL_I3C_Tgt_Config(I3C_HandleTypeDef *hi3c, const I3C_TgtConfTypeDef *pConfig);
HAL_I3C_TGT_SetConfig(hal_i3c_handle_t *hi3c, const hal_i3c_tgt_config_t *p_config);

HAL I3C control role request

HAL1

HAL2

HAL_I3C_Tgt_ControlRoleReq(I3C_HandleTypeDef *hi3c, uint32_t timeout);
HAL_I3C_TGT_ControlRoleReq(hal_i3c_handle_t *hi3c, uint32_t timeout_ms);

HAL I3C control role request with interrupt

HAL1

HAL2

HAL_I3C_Tgt_ControlRoleReq_IT(I3C_HandleTypeDef *hi3c);
HAL_I3C_TGT_ControlRoleReq_IT(hal_i3c_handle_t *hi3c);

HAL I3C target hot join request

HAL1

HAL2

HAL_I3C_Tgt_HotJoinReq(I3C_HandleTypeDef *hi3c, uint8_t *pAddress, uint32_t timeout);
HAL_I3C_TGT_EnableHotJoinRequest(const hal_i3c_handle_t *hi3c);

HAL I3C target hot join request with interrupt

HAL1

HAL2

HAL_I3C_Tgt_HotJoinReq_IT(I3C_HandleTypeDef *hi3c);
HAL_I3C_TGT_HotJoinReq_IT(hal_i3c_handle_t *hi3c);

HAL I3C target IBI request

HAL1

HAL2

HAL_I3C_Tgt_IBIReq(I3C_HandleTypeDef *hi3c, const uint8_t *pPayload,
                   uint8_t payloadSize, uint32_t timeout);
HAL_I3C_TGT_IBIReq(hal_i3c_handle_t *hi3c, const uint8_t *p_payload, uint32_t payload_size_byte,
                       uint32_t timeout_ms);

HAL I3C IBI request with interrupt

HAL1

HAL2

HAL_I3C_Tgt_IBIReq_IT(I3C_HandleTypeDef *hi3c, const uint8_t *pPayload, uint8_t payloadSize);
HAL_I3C_TGT_IBIReq_IT(hal_i3c_handle_t *hi3c, const uint8_t *p_payload, uint32_t payload_size_byte);

HAL I3C target receive data

HAL1

HAL2

HAL_I3C_Tgt_Receive(I3C_HandleTypeDef *hi3c, I3C_XferTypeDef *pXferData, uint32_t timeout);
HAL_I3C_TGT_Receive(hal_i3c_handle_t *hi3c, uint8_t *p_data, uint32_t size_byte, uint32_t timeout_ms);

HAL I3C target receive data using DMA

HAL1

HAL2

HAL_I3C_Tgt_Receive_DMA(I3C_HandleTypeDef *hi3c, I3C_XferTypeDef *pXferData);
HAL_I3C_TGT_Receive_DMA(hal_i3c_handle_t *hi3c, uint8_t *p_data, uint32_t size_byte);

HAL I3C target receive data using interrupt

HAL1

HAL2

HAL_I3C_Tgt_Receive_IT(I3C_HandleTypeDef *hi3c, I3C_XferTypeDef *pXferData);
HAL_I3C_TGT_Receive_IT(hal_i3c_handle_t *hi3c, uint8_t *p_data, uint32_t size_byte);

HAL I3C target transmit data

HAL1

HAL2

HAL_I3C_Tgt_Transmit(I3C_HandleTypeDef *hi3c, I3C_XferTypeDef *pXferData, uint32_t timeout);
HAL_I3C_TGT_Transmit(hal_i3c_handle_t *hi3c, const uint8_t *p_data, uint32_t size_byte,
                     uint32_t timeout_ms);

Related use case: Use case: I3C target transmit in polling, interrupt and DMA mode


HAL I3C target transmit data using DMA

HAL1

HAL2

HAL_I3C_Tgt_Transmit_DMA(I3C_HandleTypeDef *hi3c, I3C_XferTypeDef *pXferData);
HAL_I3C_TGT_Transmit_DMA(hal_i3c_handle_t *hi3c, const uint8_t *p_data, uint32_t size_byte);

Related use case: Use case: I3C target transmit in polling, interrupt and DMA mode


HAL I3C target transmit data using interrupt

HAL1

HAL2

HAL_I3C_Tgt_Transmit_IT(I3C_HandleTypeDef *hi3c, I3C_XferTypeDef *pXferData);
HAL_I3C_TGT_Transmit_IT(hal_i3c_handle_t *hi3c, const uint8_t *p_data, uint32_t size_byte);

Related use case: Use case: I3C target transmit in polling, interrupt and DMA mode